package com.aaa.controller.czy;

import com.aaa.service.czy.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * fileName(类名):ProductController
 * description(作用):
 * author(作者):czy
 * createTime(创建时间):2020/1/13 10:33
 * version(版本):1.0.0
 */

@RestController
@RequestMapping("product")
public class ProductController {
    /**
     * 依赖注入
     */
    @Autowired
    ProductService productService;

    /**
     * 查询商品列表
     * @param shopid
     * @return
     */
    @RequestMapping("list/{shopid}")
    public Object productList(@PathVariable("shopid") Integer shopid){
        return productService.productList(shopid);
    }
    @RequestMapping("category/{shopid}-{categoryid}")
    public Object categoryList(@PathVariable Integer shopid,@PathVariable Integer categoryid){
        return productService.productCategory(shopid, categoryid);
    }
}
